﻿#ifndef USERRELATIONINFOWIDGET_H
#define USERRELATIONINFOWIDGET_H

#include <QDialog>
#include "userrelation.h"
#include "userrelationservice.h"
#include "userservice.h"

namespace Ui {
class UserRelationInfoWidget;
}

class UserRelationInfoWidget : public QDialog
{
    Q_OBJECT

public:
    explicit UserRelationInfoWidget(QWidget *parent = nullptr);
    ~UserRelationInfoWidget();

    void setWidgetType(UserRelation::RelationType widgetType);

    void setDirectory(QStringList primaryDirectoryList, QList<QStringList> secondaryDirectoryList);

    void initWithUserRelation(UserRelation *relation);

private slots:
    void on_comboBoxPrimaryDirectory_currentIndexChanged(int index);

    void on_lineEditURClientName_textChanged(const QString &arg1);

    void on_lineEditURContact_textChanged(const QString &arg1);

    void on_lineEditURTel_textChanged(const QString &arg1);

    void on_lineEditUserNickName_textChanged(const QString &arg1);

    void on_lineEditUserTel_textChanged(const QString &arg1);

    void on_lineEditCompanyName_textChanged(const QString &arg1);

    void on_pushButtonCancel_clicked();

    void on_pushButtonBuildSubAccount_clicked();

    void on_pushButtonChangeRelation_clicked();

    void on_pushButtonSave_clicked();

    void on_pushButtonDelete_clicked();

private:
    Ui::UserRelationInfoWidget *ui;
    UserRelationService userRelationService;
    UserService userService;

    UserRelation::RelationType widgetType;
    UserRelation *relation;

    QStringList primaryDirectoryList;
    QList<QStringList> secondaryDirectoryList;
};

#endif // USERRELATIONINFOWIDGET_H
